package JavaSE.ThreadLearning.RunnableLearning.Demo01;

/**
 *  学习 使用Runnable接口实现多线程
 */
public class Demo {
    public static void main(String[] args) {
        BoomImp boomImp = new BoomImp();
        BoomImp boomImp2 = new BoomImp();
        Thread t1 = new Thread(boomImp, "辉夜");
        t1.start();
        Thread t2 = new Thread(boomImp2, "白银");
        t2.start();

    }
}

class BoomImp implements Runnable {
    public void printTheName() {
        for (int i = 0; i < 10; i++) {
            System.out.println(Thread.currentThread().getName()+"---->"+i);
        }
    }
    @Override
    public void run() {
        printTheName();
    }
}
